import request from '@/utils/request.js'
//商品列表
export const apigetProductInfoByType = (params) => {

	return request.get('blade-sale/wx/product/info/getProductInfoByType', {
		'params': params,
		dataType: "application/x-www-form-urlencoded"
	})
}
//新建订单
export const apiaddMainOrder = (params) => {

	return request.post('blade-sale/wx/maintenance/order/addMainOrder', params)

}

// 查询所有订单
export const apigetStoreOrderList = (params) => {
	return request.get('blade-sale/wx/maintenance/order/getStoreOrderListByStatusAndDriverId',{
		'params': params,
		dataType: "application/x-www-form-urlencoded"
	})
}

// 企业查询订单详情
export const getOrderDetailById = (id) => {
	return request.get('blade-sale/wx/maintenance/order/getOrderDetailById?id='+id)
}

// 企业查询未审核订单列表
export const getUnauditedOrderListByStatus = (businessId) => {
	return request.get('/blade-sale/wx/maintenance/order/getUnauditedOrderListByStatus?businessId='+businessId)
}

//查询最新的订单状态
export const apiGetNewOrderStepNumberForDriver = () => {
	return request.get('blade-sale/wx/maintenance/order/getNewOrderStepNumberForDriver', )
}

//根据订单状态按时间类型查企业订单总支出
export const getAllPriceByStatusByTimeType = (params) => {
	return request.get('blade-sale/wx/maintenance/order/getAllPriceByStatusByTimeType', {
		'params': params,
		dataType: "application/x-www-form-urlencoded"
	})
}

//获得当前企业年份总充值金额
export const getAllRechargeByYear = (params) => {
	return request.get('blade-settlement/wx/fund/trade/info/getAllRechargeByYear', {
		'params': params,
		dataType: "application/x-www-form-urlencoded"
	})
}

//获得当前企业月份总充值金额
export const getAllRechargeByMonth = (params) => {
	return request.get('blade-settlement/wx/fund/trade/info/getAllRechargeByMonth', {
		'params': params,
		dataType: "application/x-www-form-urlencoded"
	})
}

//获得当前企业年总充值记录
export const getRechargeListByYear = (params) => {
	return request.get('blade-settlement/wx/fund/trade/info/getRechargeListByYear', {
		'params': params,
		dataType: "application/x-www-form-urlencoded"
	})
}

//获得当前企业月充值记录
export const getRechargeListByMonth = (params) => {
	return request.get('blade-settlement/wx/fund/trade/info/getRechargeListByMonth', {
		'params': params,
		dataType: "application/x-www-form-urlencoded"
	})
}

//企业审核订单通过
export const companyAuditPass = (orderNumber) => {
	return request.get('blade-sale/wx/maintenance/order/companyAuditPass?orderNumber='+orderNumber)
}

//企业审核订单拒绝
export const companyAuditRefund =(params) =>{
	return request.post('blade-sale/wx/maintenance/order/companyAuditRefund', params)
}

//企业查询待审核订单
export const findAuditCarByUserId = (userId) => {
	return request.post('blade-store/wx/enterprise/car/audit/findAuditCarByUserId?userId='+userId)
}

//企业操作同意待审核订单
export const audit = (params) => {
	return request.post('blade-store/wx/enterprise/car/audit/audit', params)
}

